Mass spectrometry (MS) very accurately measures the mass-to-charge ratio in molecular species between 100 Da and 100 kDa. However, classic methods do not offer sufficient efficiency with greater particle masses, such as cells, bacteria or viruses. New nanoelectromechanical systems (NEMS) such as cantilevers or bridges enable the mass of intact objects greater than 100 kDa to be measured, which means that these structures are considered especially appropriate for studying biological complexes and nanoparticles. In nanoelectromechanical systems mass spectrometry, the sample is introduced by means of an electrospray ionization (ESI) system and the resulting ions are guided by means of an electrostatic system towards a high vacuum chamber (<; 10−5 Torr) where the resonator is located. Alternatively, matrix-assisted laser desorption/ionization (MALDI) may be used to carry the sample to the resonator. As the sample is absorbed by the resonator, sudden changes take place in the resonance frequency thereof, changes that are proportional to the mass of said particle with a proportionality constant that depends on the absorption position. Given that resonance is independent of the charge of the particle, the analysis of the data is simplified. The deconvolution of the absorption position throughout the NEMS and of the mass requires simultaneous measurement of at least two vibration modes, as proposed by Dohn et al. in “Mass and position determination of attached particles on cantilever based mass sensors”, Review of Scientific Instruments 78, 103303, 2007) and is described in patent application US2014/0156224. However, these methods do not enable the rigidity to be measured, which is a parameter that has been ignored to date as it is considered to have no influence when calculating mass.